﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using LastoRevival.Website.Models;
using System.Data;

namespace LastoRevival.Website.Data.Sql.Converters
{
	public class SiteUserSettingsCreator
	{

		public SiteUserSettings Create(DataRow settingsRow)
		{
			var instance = new SiteUserSettings
			{
				CollapseThreshold = (int)settingsRow["collapsethreshold"],
				ReturnToListAfterPosting = (bool)settingsRow["returntolistafterposting"],
				ShowSignatures = (bool)settingsRow["showsignatures"],
				SmileysByDefault = (bool)settingsRow["smileysbydefault"],
				Theme = string.Format("{0}", settingsRow["theme"]),
				TimeOffset = (double)settingsRow["timeoffset"],
			};

			return instance;
		}
	}
}